Skip to content

bpo-30249: Improve struct.unpack_from() error messages#6059

Merged
zhangyangyu merged 2 commits into
python:masterfrom
zhangyangyu:issue30249
Mar 10, 2018
Merged

bpo-30249: Improve struct.unpack_from() error messages#6059
zhangyangyu merged 2 commits into
python:masterfrom
zhangyangyu:issue30249

Conversation

@zhangyangyu

@zhangyangyu zhangyangyu commented Mar 10, 2018

Copy link
Copy Markdown
Member

Comment thread Modules/_struct.c Outdated
if (offset < 0) {
if (offset + self->s_size > 0) {
PyErr_Format(StructError,
"no space to unpack %zd bytes at offset %zd",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would better sound as "not enough data" or like.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol. That's my first draft.

@zhangyangyu
zhangyangyu merged commit c10b288 into python:master Mar 10, 2018
@zhangyangyu
zhangyangyu deleted the issue30249 branch March 10, 2018 18:58
jo2y pushed a commit to jo2y/cpython that referenced this pull request Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants